package vip.sweet.biz.modular.user.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.sweet.biz.modular.user.params.BizCartItemsAddParams;
import vip.sweet.biz.modular.user.service.BizCartItemsService;
import vip.sweet.common.enums.ResponseEnum;
import vip.sweet.common.response.CommonResponse;

/**
 * @author ASUS
 * @Date 2025/10/5 22:47
 * @Descripition
 */
@Tag(name = "业务逻辑购物车项控制器")
@RequestMapping("/biz/cartItems")
@RestController
public class BizCartItemsController {
    @Resource
    private BizCartItemsService cartItemsService;
    @PostMapping("/add")
    @Operation(summary = "添加购物车项接口")
    public CommonResponse add(@RequestBody @Validated BizCartItemsAddParams addCartItemsParams) {
        return cartItemsService.add(addCartItemsParams) ? CommonResponse.success("添加成功") : CommonResponse.error(ResponseEnum.ERROR, "添加失败");
    }
}
